/*
 *             Copyright (C) 2024 Steve Jrong
 *
 * 	   GitHub Homepage: https://www.github.com/SteveJrong
 *      Gitee Homepage: https://gitee.com/stevejrong1024
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *        https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.stevejrong.waiter.common.component;

import lombok.NoArgsConstructor;

/**
 * 常量类 - 基础常量
 *
 * @author Steve Jrong
 * @since 1.0
 */
@NoArgsConstructor
public final class BaseConstants {

    /**
     * 系统基础相关基础常量
     */
    public enum BasicSystemConstants implements ICommonEnum {
        MESSAGE_CODE {
            @Override
            public String desc() {
                return "code";
            }
        },
        MESSAGE_DATA {
            @Override
            public String desc() {
                return "data";
            }
        },
        MESSAGE_TIMESTAMP {
            @Override
            public String desc() {
                return "timestamp";
            }
        }
    }

    /**
     * 符号相关基础常量
     */
    public enum SymbolConstants implements ICommonEnum {
        SYMBOL_SPACE {
            @Override
            public String desc() {
                return " ";
            }
        },

        SYMBOL_UNDER_LINE {
            @Override
            public String desc() {
                return "_";
            }
        },
        SYMBOL_VERTICAL_LINE {
            @Override
            public String desc() {
                return "|";
            }
        },
        SYMBOL_SINGLE_FORWARD_SLASH {
            @Override
            public String desc() {
                return "/";
            }
        },
        SYMBOL_DUAL_FORWARD_SLASH {
            @Override
            public String desc() {
                return "//";
            }
        },

        SYMBOL_COMMA {
            @Override
            public String desc() {
                return ",";
            }
        },
        SYMBOL_ASTERISK {
            @Override
            public String desc() {
                return "*";
            }
        },
        SYMBOL_COLON {
            @Override
            public String desc() {
                return ":";
            }
        },
        SYMBOL_QUESTION_MARK {
            @Override
            public String desc() {
                return "?";
            }
        },

        SYMBOL_LEFT_ROUND_BRACKETS {
            @Override
            public String desc() {
                return "(";
            }
        },
        SYMBOL_RIGHT_ROUND_BRACKETS {
            @Override
            public String desc() {
                return ")";
            }
        },
        SYMBOL_LEFT_SQUARE_BRACKETS {
            @Override
            public String desc() {
                return "[";
            }
        },
        SYMBOL_RIGHT_SQUARE_BRACKETS {
            @Override
            public String desc() {
                return "]";
            }
        },
        SYMBOL_LEFT_CURLY_BRACKETS {
            @Override
            public String desc() {
                return "{";
            }
        },
        SYMBOL_RIGHT_CURLY_BRACKETS {
            @Override
            public String desc() {
                return "}";
            }
        },
        SYMBOL_SEPARATOR_ALL {
            @Override
            public String desc() {
                return "] | [";
            }
        },
    }

    /**
     * 数据编码方式相关基础常量
     */
    public enum DataCodecTypeConstants implements ICommonEnum {
        UTF8 {
            @Override
            public String desc() {
                return "UTF-8";
            }
        },
        GB2312 {
            @Override
            public String desc() {
                return "GB2312";
            }
        }
    }

    /**
     * 日期时间相关基础常量
     */
    public enum DateTimeConstants implements ICommonEnum {

        UTC_GMT8 {
            @Override
            public String desc() {
                return "+8";
            }
        },
        UTC_GMT8_ZONE_ID {
            @Override
            public String desc() {
                return "Asia/Shanghai";
            }
        },
        
        FMT_YYMMDD_WITHOUT_ANY_SEPARATOR {
        	@Override
        	public String desc() {
        		return "yyMMdd";
        	}
        },
        FMT_YYYYMMDD_WITHOUT_ANY_SEPARATOR {
        	@Override
        	public String desc() {
        		return "yyyyMMdd";
        	}
        },
        
        FMT_YYYYMMDD_HHMM_WITH_HYPHEN {
        	@Override
        	public String desc() {
        		return "yyyy-MM-dd HH:mm";
        	}
        },
        FMT_YYYY_MMDD_HHMM_WITH_SLASH {
        	@Override
        	public String desc() {
        		return "yyyy/MM/dd HH:mm";
        	}
        },
        
        FMT_YYYYMMDD_HHMMSS_WITH_HYPHEN {
            @Override
            public String desc() {
                return "yyyy-MM-dd HH:mm:ss";
            }
        },
        FMT_YYYYMMDD_HHMMSS_WITH_SLASH {
            @Override
            public String desc() {
                return "yyyy/MM/dd HH:mm:ss";
            }
        }
    }

    /**
     * HTTP请求头相关基础常量
     */
    public enum HttpHeaderConstants implements ICommonEnum {
        ACCESS_CONTROL_ALLOW_ORIGIN {
            @Override
            public String desc() {
                return "Access-Control-Allow-Origin";
            }
        },
        ACCESS_CONTROL_ALLOW_CREDENTIALS {
            @Override

            public String desc() {
                return "Access-Control-Allow-Credentials";
            }
        },
        ACCESS_CONTROL_ALLOW_METHODS {
            @Override
            public String desc() {
                return "Access-Control-Allow-Methods";
            }
        },
        ACCESS_CONTROL_ALLOW_HEADERS {
            @Override
            public String desc() {
                return "Access-Control-Allow-Headers";
            }
        },
        ACCESS_CONTROL_EXPOSE_HEADERS {
            @Override
            public String desc() {
                return "Access-Control-Expose-Headers";
            }
        },
        CONTENT_TYPE {
            @Override
            public String desc() {
                return "Content-Type";
            }
        },
        LOCATION {
            @Override
            public String desc() {
                return "Location";
            }
        },
        VARY {
            @Override
            public String desc() {
                return "Vary";
            }
        },
        AUTHORIZATION_HEADER_KEY {
            @Override
            public String desc() {
                return "Authorization";
            }
        },
        AUTHORIZATION_SCHEME {
            @Override
            public String desc() {
                return "Bearer";
            }
        }
    }

    /**
     * HTTP请求的编码方式相关基础常量
     */
    public enum HttpCodecTypeConstants implements ICommonEnum {
        APPLICATION_JSON {
            @Override
            public String desc() {
                return "application/json";
            }
        },
        APPLICATION_XML {
            @Override
            public String desc() {
                return "application/xml";
            }
        },
        APPLICATION_JSON_UTF8 {
            @Override
            public String desc() {
                return "application/json;charset=UTF-8";
            }
        }
    }

    /**
     * HTTP文档类型相关基础常量
     */
    public enum HttpMimeTypeConstants implements ICommonEnum {
        PLAIN {
            @Override
            public String desc() {
                return "text/plain";
            }
        },
        HTML {
            @Override
            public String desc() {
                return "text/html";
            }
        },
        JSON {
            @Override
            public String desc() {
                return "application/json";
            }
        }
    }

    /**
     * HTTP状态码相关基础常量
     */
    public enum HttpStatusConstants implements ICommonEnum {
        OK {
            @Override
            public String desc() {
                return "请求成功";
            }

            @Override
            public int code() {
                return 200;
            }
        },
        BAD_REQUEST {
            @Override
            public String desc() {
                return "请求参数错误";
            }

            @Override
            public int code() {
                return 400;
            }
        },
        UNAUTHORIZED {
            @Override
            public String desc() {
                return "无权限访问资源";
            }

            @Override
            public int code() {
                return 401;
            }
        },
        NOT_FOUND {
            @Override
            public String desc() {
                return "资源未找到";
            }

            @Override
            public int code() {
                return 404;
            }
        },
        FORBIDDEN {
            @Override
            public String desc() {
                return "资源访问受限";
            }

            @Override
            public int code() {
                return 403;
            }
        },
        INTERNAL_ERROR {
            @Override
            public String desc() {
                return "服务器内部错误";
            }

            @Override
            public int code() {
                return 500;
            }
        }
    }


    /**
     * 数据库相关基础常量
     */
    public enum DatabaseConstants implements ICommonEnum {
        DEFAULT_PAGE_NO {
            @Override
            public String desc() {
                return "1";
            }
        },
        DEFAULT_PAGE_ROW {
            @Override
            public String desc() {
                return "10";
            }
        }
    }

    /**
     * 算法相关基础常量
     */
    public enum AlgorithmConstants implements ICommonEnum {
        MD5 {
            @Override
            public String desc() {
                return "MD5";
            }
        },
        HS256 {
            @Override
            public String desc() {
                return "HS256";
            }
        },
        HMAC_SHA256 {
            @Override
            public String desc() {
                return "HmacSHA256";
            }
        }
    }
}